//
//  RegistService.m
//  WisdomStar
//
//  Created by 谭飞 on 2018/11/2.
//  Copyright © 2018年 zhangliwen. All rights reserved.
//

#import "RegistService.h"
#import "RegistAPI.h"

@implementation RegistService


/**
 用户注册

 @param mobile 手机号
 @param password 密码
 @param code 短信验证码
 @param is_teacher 是否老师
 @param completion 请求完成回调
 */
+ (void)registWithMobile:(NSString *)mobile password:(NSString *)password code:(NSString *)code isTeacher:(BOOL)is_teacher completion:(void (^)(id _Nonnull))completion {
    RegistAPI *api = [[RegistAPI alloc] init];
    NSMutableDictionary *mdic = [NSMutableDictionary dictionary];
    mdic[@"mobile"] = mobile;
    mdic[@"password"] = password;
    mdic[@"code"] = code;
    mdic[@"is_teacher"] = @(is_teacher);
    api.outerParameters = mdic;
    [api startWithCompletionBlockWithSuccess:^(__kindof YTKBaseRequest * _Nonnull request) {
        NSLog(@"=======注册成功");
        completion(request.responseObject);
    } failure:^(__kindof YTKBaseRequest * _Nonnull request) {
        NSLog(@"=======注册失败");
    }];
}

@end
